﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SocialNight.Entities;
using NHibernate;
using NHibernate.Cfg;

namespace SocialNight.Repository
{
    public class DalUsuario : BaseDal
    {
        public void Insert(Usuario pUsuario)
        {
            ISessionFactory sf = new Configuration().Configure().BuildSessionFactory();

            ISession secao = sf.OpenSession();

            secao.Update(pUsuario);
        }

        public Usuario Obter(int codigo)
        {
            ISessionFactory sf = new Configuration().Configure().BuildSessionFactory();

            ISession secao = sf.OpenSession();

            return secao.Get<Usuario>(codigo);
        }
    }
}
